﻿{layout:default} {class:Shop.Supplier.user.Group_power}
<lbhead>
    <title><%=Tag("编辑权限")%>-<%=Tag("商家分组")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <div class="tools">
        <ul>
            <%if (PageReturnMsg == ""){%>
            <li class="submit"><a href="javascript:void(0);" onclick="SavePower();"><b></b><span><%=Tag("保存")%></span></a></li>
            <%}%>
            <li class="rotate"><a href="javascript:void(0);" onclick="javascript:history.back();"><b></b><span><%=Tag("返回")%></span></a></li>
            <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <a href="Group.aspx"><%=Tag("商家分组")%></a> ><%=Lang(group.Name) %>
            </span></li>
        </ul>
    </div>
</lbpath>
<lbbody>
    
    <table
        class="datatitle">
        <tr>
            <td>
                <%=Tag("分组权限")%>
            </td>
        </tr>
    </table>
    <div class="proBox clear">
        <ul class="btns clear">
            
            <li class="select" onclick="$('input[name=\'id\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">
                <%=Tag("全选")%></li>
        </ul>
        <div class="iTabHead">
            <table class="datalist">
                <%foreach (Shop.Model.Lebi_Supplier_Limit pl in models)
                  {
                %>
                <tr class="list">
                    <td style="width:100px;">
                        <a href="javascript:EditObj(<%=pl.id %>)">
                            <%=Tag(pl.Name)%></a>
                    </td>
               
                    <td align="left">
                        <% 
                    int i = 0;
                    foreach (Shop.Model.Lebi_Supplier_Limit l in GetLimit(pl.id))
                    {
                        i++;
                        %>
                        <div class="limit">
                            <input type="checkbox" name="id" value="<%=l.id %>" power="true" <%=Check(l.id)?"checked":"" %> />
                            <a href="javascript:EditObj(<%=l.id %>)">
                                <%=Tag(l.Name)%></a>
                        </div>
                        <%} %>
                    </td>
                </tr>
                <%}%>
                <%if (count > 0){
                %>
                <tr class="list">
                    <td><%=Tag("未分组")%></td>
                
                    <td align="left">
                        <% 
                    int i = 0;
                    foreach (Shop.Model.Lebi_Supplier_Limit l in GetLimit(1,"default"))
                    {
                        i++;
                        %>
                        <div class="limit">
                            <input type="checkbox" name="id" value="<%=l.id %>" power="true" <%=Check(l.id)?"checked":"" %> />
                            <a href="javascript:EditObj(<%=l.id %>)">
                                <%=Tag(l.Name)%></a>
                        </div>
                        <%} %>
                    </td>
                </tr>
                <%}%>
            </table>
        </div>
    </div>
    <script type="text/javascript">
        function SavePower() {
            var postData = GetFormJsonData("power");
            var url = AdminPath+"/ajax/ajax_supplier.aspx?__Action=SavePower&gid=<%=group.id %>";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "#")});
        }
    </script>
</lbbody>
<lbbottom>
    <div class="bottom" id="body_bottom">
    </div>
</lbbottom>